<script type="text/javascript">


function validate(rel)
{
	jConfirm('Can you confirm this?', 'Confirmation Dialog', function(r) {
		if(r==true){

			
			var url = "/admin/template/delete/template_id/"+rel; 
		
			$(location).attr('href',url);

		}
		else
		{
		}
	});
}

</script>

<?php         
$this->title = "Templates";
$this->headTitle($this->title);
?>
<p><a href="<?php echo $this->url(array('controller'=>'template', 
        'action'=>'add'));?>">Add new Template</a></p>
<table id="box-table-a">
<tr>
    <th>Template Title</th>
    <th>Module</th>
    <th>Default</th>
    <th>Action</th>
</tr>
<?php foreach($this->template_arr as $template) : ?>
    <td><?php echo $this->escape($template['template_title']);?></td>
    <td><?php echo $this->escape($template['module_name']);?></td>
    <td><?php echo $this->escape($template['is_default']);?></td>
    <td>
        <a href="<?php echo $this->url(array('controller'=>'template', 
            'action'=>'edit', 'template_id'=>$template['template_id']));?>">Edit</a>
        <a rel="<?php echo $template['template_id']; ?>" onclick="validate(this.rel)"  href="#">Delete</a>
    </td>
</tr>
<?php endforeach; ?>
</table>